package com.liu.conversionNumber;

import java.util.Scanner;

public class DecimalToBinary {
    public static void main(String[] args) {
        System.out.println("请输入一个十进制数字：");
        Scanner sc = new Scanner(System.in);
        dectobin(sc.nextInt());
    }

    private static void dectobin(int x) {
        if (x < 1){
            return;
        }
        dectobin(x / 2);
        System.out.print(" " + x % 2);
    }

}
